package com.youmeek.ssm.module.user.service.impl;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.youmeek.ssm.module.user.pojo.Goods;
import com.youmeek.ssm.module.user.mapper.GoodsDao;
import com.youmeek.ssm.module.user.pojo.Page;

@Service
public class GoodsService{

    @Resource
    private GoodsDao goodsDao;

    public int insert(Goods pojo){
        return goodsDao.insert(pojo);
    }

    public int insertSelective(Goods pojo){
        return goodsDao.insertSelective(pojo);
    }

    public int insertList(List<Goods> pojos){
        return goodsDao.insertList(pojos);
    }

    // TODO: 2017/7/12 查找
    public Page<Goods> selectGoods(Page<Goods> page){
        page.setList(goodsDao.selectGoods(page));
        page.setTotal(goodsDao.selectGoodsCount(page));
        return page;
    }

    public int update(Goods pojo){
        return goodsDao.update(pojo);
    }
}
